package mt.comm;

import java.io.Serializable;

import mt.Order;

public class ClienteSideMessageImp implements ClientSideMessage, Serializable{
	
	private Type type;
	private Order order;
	private String error;
	
	
	/**
	 * Construct message to be receive by the client
	 * @param order to be process by the client
	 */
	public ClienteSideMessageImp( Order order) {
		this.order = order;
		this.type = Type.ORDER;
		
	}
	/**
	 * Construct message to be receive by the client
	 * @param error to be process by the client
	 */
	
	public ClienteSideMessageImp(String error) {
		this.error = error;
		this.type = Type.ERROR;
	}

	@Override
	public Type getType() {
		return type;
	}

	@Override
	public Order getOrder() {
		return order;
	}

	@Override
	public String getError() {
		return error;
	}

}
